#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
	int N = 0;
	scanf("%d", &N);
	int arr[N + 1];
	int i = 0;
	int j = 0;
	int k = 0;
	int insert = 0;
	scanf("%d", &insert);
	while (i < N) {
		scanf("%d", &j);
		arr[i] = j;
		i++;
	}

	arr[N] = insert;
	for (k = 0; k < N; k++) {
		for (i = 0; i < N - k; i++) {
			if (arr[i + 1] < arr[i]) {
				int tmp = arr[i];
				arr[i] = arr[i + 1];
				arr[i + 1] = tmp;
			}
		}
	}


	for (i = 0; i < N + 1; i++) {
		printf("%d ", arr[i]);

	}


	return 0;
}